<?php
class FamilyModel extends Model{
	var $tableName	=	'family';

	//获取家庭成员
	public function getMembers($uid=0) {
		//创建默认相册
		if( intval($uid) <= 0 ){
			$uid	=	$this->mid;
		}

		$members = $this->where("uid='$uid'")->order('relation asc')->findAll();
		if(empty($members)){
			return array();
		}
		$members = indexArray($members, 'relation');
		return $members;
	}

	//更新亲人信息
	function updateSet($uid, $data) {

		$count	=	D('Photo')->where("albumId='$aid' AND isDel=0")->count();
		$map['photoCount']	=	$count;
		return $this->where("id='$aid'")->save($map);
	}

}
?>